
{% load i18n %}
{% block title %} Tu Negocio Empresarios -Estadisticas {% endblock %}

{% block head-js-ext %}
    <!--<script type="text/javascript" src="https://www.google.com/jsapi"></script>-->
    <script type="text/javascript" src="{{MEDIA_URL}}js/jquery.js"></script>
    <script type="text/javascript" src="{{MEDIA_URL}}js/jquery.json.js"></script>
    <script type="text/javascript" src="{{MEDIA_URL}}js/FusionCharts.js"></script>    
{% endblock %}
{% block head-js-embedded %}
    <script type="text/javascript" charset="utf-8">        
        $(document).ready(function(){
            
            json_data = new String();
            var url = "{% url ver_estadisticas %}";
            $.getJSON(url, function (data) {
                json_data = $.toJSON(data);
                
                $("input[name='selection']").change(function(){
                    var valor = $("input[name='selection']:checked").val();
                    if(valor == 1)
                    {
                        var myChart = new FusionCharts("{{MEDIA_URL}}charts/Pie3D.swf", "myChartId", "600", "500", "0", "1" );
                    }
                    else if(valor == 2)
                    {
                        var myChart = new FusionCharts("{{MEDIA_URL}}charts/Column3D.swf", "myChartId", "600", "500", "0", "1" );    
                    }
                    myChart.setJSONData(json_data);                
                    myChart.render("chart_div");
                });         
            });       
        });
    </script>

{% endblock %}

{% block content-box1 %}
    {% if user.is_authenticated %}    
        <form>
            <input type="radio" name="selection" value="1" />Pie<br />
            <input type="radio" name="selection" value="2" />Colum<br />
        </form>    
        <div id="chart_div"></div>
        
        
        
        
        
        
        
        
        
        
    {% endif %}
{% endblock %}
